<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>实验拓扑</title>
	<%--<meta name="decorator" content="default"/>--%>
	<link rel="stylesheet" type="text/css" href="${path}/css/resource/easyui.css">
	<link href="${path}/css/resource/flowPath.css" type="text/css" rel="stylesheet" />
	<script type="text/javascript">
		function saveTopology(topologyXml){

			var id=$("#id").val();
			var ctfEnvironmentName=$("#ctfEnvironmentName").val();
			var ctfEnvironmentType=$("#ctfEnvironmentType").val();
			var ctfEnvironmentTime=$("#ctfEnvironmentTime").val();
			var label=$("#label").val();
			var increaseTimeAllow=$("#increaseTimeAllow").val();
			var increaseTime=$("#increaseTime").val();
			var increaseNumber=$("#increaseNumber").val();
			var answerType=$("#answerType").val();
			var password=$("#password").val();
			var account=$("#account").val();
			var fixedAnswer=$("#fixedAnswer").val();
			var ctfType=$("#ctfType").val();
			var ip=$("#ip").val();
			var port=$("#port").val();

			$.ajax({
				type: "POST",
				url: "${ctx}/scene/sceneCtfEnvironment/saveTopology",
				data: {
					topologyXml:topologyXml,
					id:id,
					ctfEnvironmentName:ctfEnvironmentName,
					ctfEnvironmentType:ctfEnvironmentType,
					ctfEnvironmentTime:ctfEnvironmentTime,
					label:label,
					increaseTimeAllow:increaseTimeAllow,
					increaseTime:increaseTime,
					increaseNumber:increaseNumber,
					answerType:answerType,
					password:password,
					account:account,
					fixedAnswer:fixedAnswer,
					ctfType:ctfType,
					ip:ip,
					port:port

				},
				success:function(jsonModel){
					<%--window.location.href="${ctx}/scene/sceneEnvironment/";--%>
					if(jsonModel.success)
						window.location.href="${ctx}/scene/sceneRouter/topologyRouterList?environmentId="+jsonModel.dataObj+"&type=ctf";
					else{
						alert(jsonModel.dataObj);

					}
				},
				error:function(){
					alert("保存实验环境失败");
				}
			});
		}

		function configCtfSetBox(){
			top.$.jBox("<div class='form-search' style='padding-left:20px; padding-top: 20px; padding-bottom: 15px;'>是否可以查看解题思路</div>"+
					"<div class='form-search' style='padding-left:30px; padding-bottom: 20px;'><input type='radio' id='solutionYes' name='solutionIsAllow' value='0'/>是<br/>"+
					"<input type='radio' id='solutionNo' name='solutionIsAllow' value='1' checked='checked'/>否</div>",
					{
						title: "配置CTF题目集",
						submit: function (v, h, f) {
							alert("hahaha"+ f.solutionIsAllow);

						}
					});
			return false;
		}

	</script>
	<STYLE>
		v\:*{behavior:url(#default#VML);}
	</STYLE>
	<style type="text/css">
		*
		{
			margin:0px;
			padding:0px;
		}
		.zhezhao
		{
			width:100%;
			height:100%;
			/*background-color:#fff;*/
			filter:alpha(opacity=0);
			-moz-opacity:0.5;
			opacity:0.5;
			position:absolute;
			left:0px;
			top:0px;
			display:none;
			z-index:1000;
		}
	</style>
</head>
<body class="easyui-layout bodySelectNone" id="body" onselectstart="return false">
<input type="hidden" id="id" value="${sceneCtfEnvironment.id}">
<input type="hidden" id="ctfEnvironmentName" name="environmentName" value="${sceneCtfEnvironment.ctfEnvironmentName}">
<input type="hidden" id="ctfEnvironmentType" value="${sceneCtfEnvironment.ctfEnvironmentType}">
<input type="hidden" id="ctfEnvironmentTime" value="${sceneCtfEnvironment.ctfEnvironmentTime}">
<input type="hidden" id="label" value="${sceneCtfEnvironment.label}">
<input type="hidden" id="increaseTimeAllow" value="${sceneCtfEnvironment.increaseTimeAllow}">
<input type="hidden" id="increaseTime" value="${sceneCtfEnvironment.increaseTime}">
<input type="hidden" id="increaseNumber" value="${sceneCtfEnvironment.increaseNumber}">
<input type="hidden" id="answerType" value="${sceneCtfEnvironment.answerType}">
<input type="hidden" id="password" value="${sceneCtfEnvironment.password}">
<input type="hidden" id="account" value="${sceneCtfEnvironment.account}">
<input type="hidden" id="fixedAnswer" value="${sceneCtfEnvironment.fixedAnswer}">
<input type="hidden" id="ctfType" value="${sceneCtfEnvironment.ctfType}">
<input type="hidden" id="ip" value="${sceneCtfEnvironment.ip}">
<input type="hidden" id="port" value="${sceneCtfEnvironment.port}">
<input type="hidden" id="remarks" value="${sceneCtfEnvironment.remarks}">
<%--<input type="hidden" id="topologyXml" value='${sceneCtfEnvironment.topologyXml}'>--%>
<div class="zhezhao" id="zhezhao"></div>
<div id="title" region="north" split="true" border="false" title="工具栏" class="titleTool">
	<div id="message" class="message"></div>
	<div>

	<img alt="合并" title="合并" src="${path}/static/images/topology/1.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.toMerge()"</c:if> class="buttonStyle" />
	<img alt="拆分" title="拆分" src="${path}/static/images/topology/2.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.toSplit()"</c:if> class="buttonStyle"/>
	<img alt="置顶"	title="置顶" src="${path}/static/images/topology/4.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.toTop()"</c:if> class="buttonStyle"/>
	<img alt="置底"	title="置底" src="${path}/static/images/topology/3.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.toBottom()"</c:if> class="buttonStyle"/>
	<img alt="预览"	title="预览" src="${path}/static/images/topology/zoom.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.printView()"</c:if> class="buttonStyle"/>
	<img alt="打印" title="打印" src="${path}/static/images/topology/printer.png"  class="buttonStyle"/>
	<img alt="撤销"	title="撤销" src="${path}/static/images/topology/back.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.undo();"</c:if> class="buttonStyle"/>
	<img alt="重做"	title="重做" src="${path}/static/images/topology/next.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.redo();"</c:if> class="buttonStyle"/>
	<img alt="保存"	title="保存" src="${path}/static/images/topology/save.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.xmlReturn();saveTopology(xml);"</c:if> class="buttonStyle"/>
	<%--saveTopology(xml);--%>
	<%--<img alt="保存"	title="保存" src="${path}/static/images/topology/save.png" onclick="graphUtils.xmlReturn();window.location.href='${ctx}/scene/sceneEnvironment/saveTopology?topologyXml='+xml;alert(xml);" class="buttonStyle"/>--%>
	<img alt="加载"	title="加载" src="${path}/static/images/topology/download_page.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.loadXml(xml)"</c:if> class="buttonStyle"/>
	<img alt="清空"	title="清空" src="${path}/static/images/topology/trash.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.clearHtml();"</c:if> class="buttonStyle"/>
	<img alt="复制"	title="复制" src="${path}/static/images/topology/copy.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.copyNode();"</c:if> class="buttonStyle"/>
	<img alt="删除"	title="删除" src="${path}/static/images/topology/delete.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.removeNode();"</c:if> class="buttonStyle"/>
	<img alt="左对齐"	title="左对齐" src="${path}/static/images/topology/toLeft.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.alignLeft();"</c:if> class="buttonStyle"/>
	<img alt="垂直居中"	title="垂直居中" src="${path}/static/images/topology/toMiddleWidth.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.verticalCenter();"</c:if> class="buttonStyle"/>
	<img alt="右对齐"	title="右对齐" src="${path}/static/images/topology/toRight.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.alignRight();"</c:if> class="buttonStyle"/>
	<img alt="顶对齐"	title="顶对齐" src="${path}/static/images/topology/toTop.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.alignTop();"</c:if> class="buttonStyle"/>
	<img alt="水平居中"	title="水平居中" src="${path}/static/images/topology/toMiddleHeight.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.horizontalCenter();"</c:if> class="buttonStyle"/>
	<img alt="底对齐"	title="底对齐" src="${path}/static/images/topology/toBottom.png" <c:if test="${stuOperate!='yes'}">onclick="graphUtils.bottomAlignment();"</c:if> class="buttonStyle"/>

	</div>
</div>

<div id="leftContent" region="west" split="true" title="图元区" class="leftContent">

	<div class="easyui-accordion overflowHidden" fit="true" border="false">

		<div title="基本图形" style="overflow:hidden;background-color:#c7dbfc;">
			<div>
			<div id="baseLine2" style="position:absolute;left:10px;top:30px !important;top:10px">
				<div class="title">&nbsp;</div>
				<img id="backGroundImg3" src="${path}/static/images/topology/line3.png" class="nodeStyle"/>
			</div>

			<div id="baseLine3" style="position:absolute;left:50px;top:30px !important;top:10px">
				<div class="title">&nbsp;</div>
				<img id="backGroundImg2" src="${path}/static/images/topology/line2.png" class="nodeStyle"/>
			</div>

			<div id="baseLine1" style="position:absolute;left:90px;top:30px !important;top:10px">
				<div class="title">&nbsp;</div>
				<img id="backGroundImg1" src="${path}/static/images/topology/line1.png" class="nodeStyle"/>
			</div>

			<div id="baseMode1" divType="mode" style="position:absolute;left:10px;top:70px !important;top:50px">
				<div class="title">&nbsp;</div>
				<img id="backGroundImg4" src="${path}/static/images/topology/baseMode1.png" class="nodeStyle"/>
			</div>

			<div id="baseMode2" divType="mode" style="position:absolute;left:50px;top:70px !important;top:50px">
				<div class="title">&nbsp;</div>
				<img id="backGroundImg5" src="${path}/static/images/topology/baseMode2.png" class="nodeStyle"/>
			</div>

			<div id="baseMode3" divType="mode" style="position:absolute;left:90px;top:70px !important;top:50px">
                <div class="title">&nbsp;</div>
                <img id="backGroundImg6" src="${path}/static/images/topology/baseMode3.png" class="nodeStyle"/>
            </div>

            <div id="baseMode4" divType="mode" style="position:absolute;left:50px;top:106px !important;top:86px">
                <div class="title">&nbsp;</div>
                <img id="backGroundImg7" src="${path}/static/images/topology/baseMode4.png" class="nodeStyle"/>
            </div>

            <div id="baseMode5" divType="mode" style="position:absolute;left:10px;top:106px !important;top:86px">
                <div class="title">&nbsp;</div>
                <img id="backGroundImg8" src="${path}/static/images/topology/baseMode5.png" class="nodeStyle"/>
            </div>
			</div>
</div>

</div>

</div>

<div region="center" title="绘图区" id="contextBody" class="mapContext" >

<!-- Line右键菜单 -->
	<div id="lineRightMenu" class="modeRight" <c:if test="${stuOperate=='yes'}">hidden</c:if>>
		<div class="modeRightTop"></div>
		<div class="modeRightDel" onmousemove="this.style.backgroundColor='#c5e7f6'" onclick="graphUtils.removeNode();" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">删 除</span></div>
		<div class="modeRightPro" onmousemove="this.style.backgroundColor='#c5e7f6'" onclick="graphUtils.showLinePro();" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">属 性</span></div>
		<div class="modeRightButtom"></div>
	</div>

	<!-- Mode右键菜单 -->
	<div id="rightMenu" class="modeRight" <c:if test="${stuOperate=='yes'}">hidden</c:if>>
		<div class="modeRightTop"></div>
		<div class="modeRightCopy" onmousemove="this.style.backgroundColor='#c5e7f6'" onclick="graphUtils.copyNode();" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">复 制</span></div>
		<div class="modeRightDel" onmousemove="this.style.backgroundColor='#c5e7f6'" onclick="graphUtils.removeNode();" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">删 除</span></div>
		<div class="modeRightPro" onmousemove="this.style.backgroundColor='#c5e7f6'" onclick="graphUtils.showModePro();" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">属 性</span></div>
		<%--<div class="modeRightPro" onmousemove="this.style.backgroundColor='#c5e7f6'" onclick="return configCtfSetBox();" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">设 置</span></div>--%>
		<div class="modeRightButtom"></div>
	</div>

	<!-- PathBody右键菜单 -->
	<div id="pathBodyRightMenu" class="modeRight" <c:if test="${stuOperate=='yes'}">hidden</c:if>>

		<div class="modeRightTop"></div>
		<div class="modeRightPixel" id="isPixel" onclick="global.baseTool.changStyle(this);" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">Pixel</span></div>
		<div class="modeRightLeft" onclick="graphUtils.alignLeft();" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">左对齐</span></div>
		<div class="modeRightCenter" onclick="graphUtils.verticalCenter();" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">垂直居中</span></div>
		<div class="modeRightRight" onclick="graphUtils.alignRight();" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">右对齐</span></div>
		<div class="modeRightHead" onclick="graphUtils.alignTop();" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">顶部对齐</span></div>
		<div class="modeRightMiddle" onclick="graphUtils.horizontalCenter();" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">水平居中</span></div>
		<div class="modeRightFoot" onclick="graphUtils.bottomAlignment();" onmousemove="this.style.backgroundColor='#c5e7f6'" onmouseout="this.style.backgroundColor=''"><span class="menuSpan">底端对齐</span></div>
		<div class="modeRightButtom"></div>
	</div>

	<div id="topCross"></div>
	<div id="leftCross"></div>

</div>

<!-- <div region="east" split="true" title="历史操作" class="history">
    <div id="historyMessage" class="historyMessage"></div>
</div> -->

<div region="south"  split="true" title="辅助区" class="auxiliaryArea" >
	<!-- 小地图 -->
	<div id="smallMap"></div>

	<div id="mainControl">

		<div id="tab" class="control">

			<h3 id="h1" class="hclass" onClick="hOnMouseOver(this, '1')">
				&nbsp;<img src="${path}/static/images/topology/img1.png" style="vertical-align:middle;" />&nbsp;&nbsp;模型名称
			</h3>
			<div id="tab1" class="htabup">

				<table cellpadding="0" cellspacing="0">
					<tr>
						<td style="text-align:center;height:25px;">
							标题
						</td>
						<td colspan="7">
							<%--<select>--%>
								<%--<option>a</option>--%>
							<%--</select>--%>
							<input type="text" id="inputTitle" class="inputComm" style="width:300px;"/>
						</td>
					</tr>
					<tr>
						<td style="width:70px;text-align:center;">
							内容
						</td>
						<td colspan="7">
							<textarea rows="3" id="modeContent" class="contextArea" ></textarea>
						</td>
					</tr>

				</table>

			</div>

			<h3 id="h2" class="hclass" onClick="hOnMouseOver(this, '2')">
				&nbsp;<img src="${path}/static/images/topology/img2.png" style="vertical-align:middle;" />&nbsp;&nbsp;模型属性
			</h3>
			<div id="tab2" class="htab">
				<table cellpadding="0" cellspacing="0">
					<tr>
						<td style="width:70px;height:25px;text-align:center;">
							宽
						</td>
						<td>
							<input type="text" id="inputWidth" class="inputComm" style="width:50px;"/>
						</td>
						<td style="width:70px;text-align:center;">
							高
						</td>
						<td>
							<input type="text" id="inputHeight" class="inputComm" style="width:50px;" />
						</td>

					</tr>
					<tr>
						<td style="text-align:center;">
							上边距
						</td>
						<td>
							<input type="text" id="inputTop" class="inputComm" style="width:50px;" />
						</td>
						<td style="text-align:center;">
							左边距
						</td>
						<td>
							<input type="text" id="inputLeft" class="inputComm" style="width:50px;" />
						</td>
					</tr>

				</table>
			</div>

			<!-- 不展示的区域 -->
			<h3 id="h3" class="hclass" onClick="hOnMouseOver(this, '3')" style="display:none;">
				&nbsp;<img src="${path}/static/images/topology/img3.png" style="vertical-align:middle;" />&nbsp;&nbsp;模型背景
			</h3>
			<div id="tab3" class="htab" style="display:none;">

				<table cellpadding="0" cellspacing="0">

					<tr>

						<td style="width:70px;text-align:center;">
							背景图
						</td>

						<td colspan="6">
							<input type="text" id="inputImgSrc" class="inputComm" style="width:500px;" />
						</td>

					</tr>

				</table>

			</div>

		</div>

	</div>
	<div id="show" class="show">

		<div id="nullCount" class="showItem"></div>
		<div id="lineCount" class="showItem"></div>
		<div id="modeCount" class="showItem"></div>
		<div id="contextCount" class="showItem"></div>

	</div>

</div>

<!-- 移动时的图象 -->
<div id="moveBaseMode" class="moveBaseMode">
	<img id="moveBaseModeImg"  src="${path}/static/images/topology/Favourite.png" class="nodeStyle"/>
</div>

<div id="prop" style="visibility: hidden;">
	Dialog Content.
</div>

</body>

<script src="${path}/js/resource/lin/jquery.min-1.7.js" type="text/javascript"></script>
<script src="${path}/js/resource/lin/jquery.easyui.min.js" type="text/javascript"></script>
<script src="${path}/js/resource/lin/strawberry.min.js" type="text/javascript" language="javascript"></script>

<script>
//	var dataprop;
	var envInfoUrl="${ctx}/scene/sceneEnvironment/envInfo";
	var mainControl = $id("mainControl");
	mainControl.style.width = (document.body.offsetWidth - 412) + "px";

	var bgImg = "url(${path}/static/images/topology/bg.gif)";
	var backColor = "#e0ecff";

	function hOnMouseOver(tagObj, index) {

		var h1 = $id("h1");
		var h2 = $id("h2");
		var h3 = $id("h3");

		var tab1 = $id("tab1");
		var tab2 = $id("tab2");
		var tab3 = $id("tab3");

		var setHClass = function (obj, colorValue, indexValue) {

			obj.style.background = colorValue;
			obj.style.zIndex = indexValue;

		};

		var setTagClass = function (obj, className) {

			obj.setAttribute("class", className);
			obj.setAttribute("className", className);

		};

		setHClass(h1, bgImg, "1");
		setHClass(h2, bgImg, "1");
		setHClass(h3, bgImg, "1");

		setTagClass(tab1, "htab");
		setTagClass(tab2, "htab");
		setTagClass(tab3, "htab");

		setHClass(tagObj, backColor,"3");
		setTagClass($id("tab" + index), "htabup");

	}

	jQuery(document).ready(function () {

		<%--$.ajax({--%>
			<%--type: "POST",--%>
			<%--url: "${ctx}/scene/sceneEnvironment/envInfo",--%>
			<%--success: function (json) {--%>
<%--//				var routerList=json.dataObj.routerList;--%>
<%--//				var networkList=json.dataObj.networkList;--%>
<%--//				var securityGroupList=json.dataObj.securityGroupList;--%>
<%--//				var vmTemplateList=json.dataObj.vmTemplateList;--%>
<%--//				var routerAttri = new Array();--%>
<%--//				for(var i=0;i<routerList.length;i++)--%>
<%--//				{--%>
<%--//					if(i==0)--%>
<%--//						routerAttri.push("1="+routerList[i].id+"&&"+routerList[i].routerName);--%>
<%--//					else--%>
<%--//						routerAttri.push("0="+routerList[i].id+"&&"+routerList[i].routerName);--%>
<%--//				}--%>
<%--//				var networkAttri = new Array();--%>
<%--//				for(var i=0;i<networkList.length;i++)--%>
<%--//				{--%>
<%--//					if(i==0)--%>
<%--//						networkAttri.push("1="+networkList[i].id+"&&"+networkList[i].networkName);--%>
<%--//					else--%>
<%--//						networkAttri.push("0="+networkList[i].id+"&&"+networkList[i].networkName);--%>
<%--//				}--%>
<%--//				var securityGroupAttri = new Array();--%>
<%--//				for(var i=0;i<securityGroupList.length;i++)--%>
<%--//				{--%>
<%--//					if(i==0)--%>
<%--//						securityGroupAttri.push("1="+securityGroupList[i].id+"&&"+securityGroupList[i].name);--%>
<%--//					else--%>
<%--//						securityGroupAttri.push("0="+securityGroupList[i].id+"&&"+securityGroupList[i].name);--%>
<%--//				}--%>
<%--//				var vmTemplateAttri = new Array();--%>
<%--//				for(var i=0;i<vmTemplateList.length;i++)--%>
<%--//				{--%>
<%--//					if(i==0)--%>
<%--//						vmTemplateAttri.push("1="+vmTemplateList[i].id+"&&"+vmTemplateList[i].name);--%>
<%--//					else--%>
<%--//						vmTemplateAttri.push("0="+vmTemplateList[i].id+"&&"+vmTemplateList[i].name);--%>
<%--//				}--%>

				<%--dataprop={--%>
					<%--a:{--%>
						<%--"public-network": ["1=0f101954-e971-4f91-b03a-0f2533c19cb&&public"]--%>
					<%--},--%>
					<%--b:{--%>
						<%--"router": json.dataObj.routerAttri--%>
					<%--},--%>
					<%--c:{--%>
						<%--"Network": json.dataObj.networkAttri--%>
					<%--},--%>
					<%--d:{--%>
						<%--"VmTemplate": json.dataObj.vmTemplateAttri--%>
					<%--},--%>
					<%--e:{--%>
						<%--"SecurityGroup": json.dataObj.securityGroupAttri--%>
					<%--}--%>
				<%--};--%>


			<%--},--%>
			<%--error:function(){--%>
				<%--alert("error");--%>
			<%--}--%>
		<%--});--%>



		$id("h1").style.background = "#e0ecff";
		$id("h1").style.zIndex = "3";

		var global = com.xjwgraph.Global;

		graphUtils = com.xjwgraph.Utils.create({

			contextBody : 'contextBody',
			width : 1600,
			height : 1000,
			smallMap : 'smallMap',
			mainControl : 'mainControl',
			historyMessage : 'historyMessage',
			prop : 'prop'

		});


		graphUtils.nodeDrag($id("baseLine1"), true, 1);
		graphUtils.nodeDrag($id("baseLine2"), true, 2);
		graphUtils.nodeDrag($id("baseLine3"), true, 3);

		var modes = jQuery("[divType='mode']");
		var modeLength = modes.length;

		for (var i = 0; i < modeLength; i++) {
			graphUtils.nodeDrag(modes[i]);
		}

		document.body.onclick = function () {

			if (!stopEvent) {
				global.modeTool.clear();
			}

		};

		function countModule() {

			stopEvent = false;

			var lineCount = global.lineMap.size();
			var modeCount = global.modeMap.size();
			var contextCount = global.baseTool.contextMap.size();

			$id("lineCount").innerHTML = "线总数:" + lineCount;
			$id("modeCount").innerHTML = "模型数:" + modeCount;

			$id("contextCount").innerHTML = "区域数:" + contextCount;

		}

		countModule();



		document.onclick = countModule;
		document.onkeydown = KeyDown;
		$(".modeRightPro").on("click",function(){
			$('.easyui-combobox').combobox({
				onSelect:function(record){
					$(this).val(record.value);
				}
			});
		});
		<%--var topologyXml=${sceneEnvironment.id};--%>
		<%--alert(topologyXml);--%>

//		var xmlText=$("#topologyXml").val();
//		console.log("xmlText="+xmlText);
//		if(xmlText!=null&&xmlText!='')
//		{
//			graphUtils.loadTextXml(xmlText);
//		}environmentName

		<%--alert("${sceneEnvironment.topologyXml}");--%>
		if("${stuOperate}"=='yes')
		{
			var zhezhao=document.getElementById("zhezhao");

			zhezhao.style.display="block";
		}
		var xmlText = '<?xml version="1.0" encoding="utf8"?><modes><mode classname="module" class="module" attr_prop_Network="1=7286e99df53e4295a27e0b0c02c1325b&amp;&amp;network11d,0=7c25fc054ae2450a9008c9636f34b411&amp;&amp;net11,0=d8334460168b4cb58c1f9a10e0bdf3fd&amp;&amp;network10,0=40df31b8707d437497a158a29e3660a0&amp;&amp;network5,0=6cd92098ea8848c79a008930741934df&amp;&amp;network74,0=bd880d8dcf6347afb026dbe5bdfa6687&amp;&amp;network2a,0=7d09fa27c3b247eb968a975831d7aa10&amp;&amp;network1a,0=f2f9d2bf9a524436b4df76c736bb0fca&amp;&amp;network1" id="15" title="够够够" backImgSrc="http://localhost:8080/static/images/topology/baseMode3.png" top="186" left="576" zIndex="15" width="50" height="50"/><mode classname="module" class="module" attr_prop_router="1=eeb95feb839c4ff686b98389cc1e159e&amp;&amp;router11,0=d8b7aae6b4274e2888ac888254c4d98e&amp;&amp;router5,0=a8fa06b773d54f3783e33154af81c24f&amp;&amp;router74,0=8910539aef054c289f3f8052712e7b2d&amp;&amp;router2a,0=70ba0d57ee954da0961368fe132d97ae&amp;&amp;router1a,0=4b04174e3ed249f8805af3000d896afe&amp;&amp;router1" id="12" title="刷涮涮" backImgSrc="http://localhost:8080/static/images/topology/baseMode2.png" top="92" left="296" zIndex="12" width="50" height="50"/></modes>';
		if("${sceneCtfEnvironment.topologyXml}"!=null&&"${sceneCtfEnvironment.topologyXml}"!='')
		{
			graphUtils.loadTextXml("${sceneCtfEnvironment.topologyXml}");
		}
//		graphUtils.loadTextXml(xmlText);
	});


</script>
</html>